package cn.tedu.spring.eg2;

import cn.tedu.spring.bean.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author 董代恒
 * @version 1.0
 */
public class TestMapper {
    public static void main(String[] args) {
        //1.创建Ioc容器
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.eg2");
        //2.获取bean对象
        Mapper mapper1 = context.getBean("mapperImpl1",Mapper.class);
        Mapper mapper2 = context.getBean("mapperImpl2",Mapper.class);
        //3.打印bean对象地址

        System.out.println(mapper1);
        System.out.println(mapper2);
    }
}
